Component({
  options: {
    styleIsolation: 'shared',
    activeValues: [0],
  },
  properties: {
    userInfo: {
      type: Object,
      value: {
      }
    }
  },
  data: {
    deliveryType: true, //默认外卖
    userInfo:{}
  },
  lifetimes: {
    ready() {
      this.setData({
        userInfo:getApp().globalData.defaultAddress
      })
      const _this=this
      getApp().eventBus.on("defaultAddressUpdate",(newDefaultAddress)=>{
        _this.setData({
          userInfo:newDefaultAddress
        })
      })
    },
  },
  methods: {
    handleChangeOrderType(e) {
      this.setData({
        deliveryType: e.detail.value,
      });
    },
    showAddressDetails(e) {
      this.setData({
        activeValues: e.detail.value,
      });
    },
    handleChangeAddress(e) {
      wx.navigateTo({
        url: '/pages/user-address/index?modalType=2',
      })
    },
    changeTitle() {},
    newAddress() {
      wx.navigateTo({
        url: '/pages/user-address/index?modalType=2',
      })
    },
  },
});